Attribute VB_Name = "Declarations"
Option Private Module
Option Explicit

Type RECT
    Left As Long
    Top As Long
    Right As Long
    Bottom As Long
End Type
Type LOGBRUSH
    lbStyle As Long
    lbColor As Long
    lbHatch As Long
End Type

Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Any) As Long

Public Enum StockObjects
    WHITE_BRUSH = 0
    LTGRAY_BRUSH = 1
    GRAY_BRUSH = 2
    DKGRAY_BRUSH = 3
    BLACK_BRUSH = 4
    NULL_BRUSH = 5
    HOLLOW_BRUSH = NULL_BRUSH
    WHITE_PEN = 6
    BLACK_PEN = 7
    NULL_PEN = 8
    OEM_FIXED_FONT = 10
    ANSI_FIXED_FONT = 11
    ANSI_VAR_FONT = 12
    SYSTEM_FONT = 13
    DEVICE_DEFAULT_FONT = 14
    DEFAULT_PALETTE = 15
    SYSTEM_FIXED_FONT = 16
End Enum

Declare Function FillRect Lib "user32" (ByVal hdc As Long, lpRect As RECT, ByVal hBrush As Long) As Long
Declare Function CreateBrushIndirect Lib "gdi32" (lpLogBrush As LOGBRUSH) As Long
Declare Function CallWindowProc Lib "user32" Alias "CallWindowProcA" (ByVal wndrpcPrev As Long, ByVal hWnd As Long, ByVal uMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Declare Function SelectObject Lib "gdi32" (ByVal hdc As Long, ByVal hObject As Long) As Long
Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
Declare Function GetStockObject Lib "gdi32" (ByVal nIndex As StockObjects) As Long
Declare Function MoveToEx Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, lpPoint As Any) As Long
Declare Function LineTo Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long) As Long

Public Const BS_SOLID As Long = 0

Public Const GWL_WNDPROC As Long = -4

Declare Function GetFocus Lib "user32" () As Long

Public Enum DrawTextFormats
    DT_TOP = &H0
    DT_LEFT = &H0
    DT_CENTER = &H1
    DT_RIGHT = &H2
    DT_VCENTER = &H4
    DT_BOTTOM = &H8
    DT_WORDBREAK = &H10
    DT_SINGLELINE = &H20
    DT_EXPANDTABS = &H40
    DT_TABSTOP = &H80
    DT_NOCLIP = &H100
    DT_EXTERNALLEADING = &H200
    DT_CALCRECT = &H400
    DT_NOPREFIX = &H800
    DT_INTERNAL = &H1000
End Enum

Declare Function SetBkColor Lib "gdi32" (ByVal hdc As Long, ByVal crColor As Long) As Long
Declare Function GetSysColor Lib "user32" (ByVal nIndex As Long) As Long
Declare Function CreatePen Lib "gdi32" (ByVal nPenStyle As Long, ByVal nWidth As Long, ByVal crColor As Long) As Long
Declare Function Rectangle Lib "gdi32" (ByVal hdc As Long, ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
Declare Function DrawText Lib "user32" Alias "DrawTextA" (ByVal hdc As Long, ByVal lpstr As String, ByVal nCount As Long, lpRect As RECT, ByVal wFormat As DrawTextFormats) As Long
Declare Function SetTextColor Lib "gdi32" (ByVal hdc As Long, ByVal crColor As Long) As Long
Declare Function DrawFocusRect Lib "user32" (ByVal hdc As Long, lpRect As RECT) As Long

Public Const COLOR_BACKGROUND As Long = 1
Public Const COLOR_WINDOW As Long = 5
Public Const COLOR_WINDOWTEXT As Long = 8
Public Const COLOR_HIGHLIGHT As Long = 13
Public Const COLOR_HIGHLIGHTTEXT As Long = 14
Public Const COLOR_BTNFACE As Long = 15

Public Const PS_SOLID As Long = 0

Public Const LB_ADDSTRING As Long = &H180
Public Const LB_INSERTSTRING As Long = &H181
Public Const LB_GETITEMDATA As Long = &H199
Public Const LB_SETITEMDATA  As Long = &H19A
Public Const LB_GETCARETINDEX As Long = &H19F

'Owner draw type
Public Enum OwnerDrawType
    ODT_MENU = 1
    ODT_LISTBOX = 2
    ODT_COMBOBOX = 3
    ODT_BUTTON = 4
End Enum


'Owner draw action
Public Enum OwnerDrawAction
    ODA_DRAWENTIRE = &H1
    ODA_SELECT = &H2
    ODA_FOCUS = &H4
End Enum

' Owner draw state
Public Enum OwnerDrawState
    ODS_SELECTED = &H1
    ODS_GRAYED = &H2
    ODS_DISABLED = &H4
    ODS_CHECKED = &H8
    ODS_FOCUS = &H10
End Enum

Public Const WM_DRAWITEM As Long = &H2B
Public Const WM_SYSCOLORCHANGE As Long = &H15

Public Type DRAWITEMSTRUCT
    CtlType As OwnerDrawType
    CtlID As Long
    itemID As Long
    itemAction As OwnerDrawAction
    itemState As OwnerDrawState
    hwndItem As Long
    hdc As Long
    rcItem As RECT
    ItemData As Long
End Type
